\(\int \frac {(2+x) (d+e x)}{4-5 x^2+x^4} \, dx\) [80]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 21, antiderivative size = 42 \[ \int \frac {(2+x) (d+e x)}{4-5 x^2+x^4} \, dx=-\frac {1}{2} (d+e) \log (1-x)+\frac {1}{3} (d+2 e) \log (2-x)+\frac {1}{6} (d-e) \log (1+x) \]

[Out]

-1/2*(d+e)*ln(1-x)+1/3*(d+2*e)*ln(2-x)+1/6*(d-e)*ln(1+x)

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 42, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {1600, 2099} \[ \int \frac {(2+x) (d+e x)}{4-5 x^2+x^4} \, dx=-\frac {1}{2} (d+e) \log (1-x)+\frac {1}{3} (d+2 e) \log (2-x)+\frac {1}{6} (d-e) \log (x+1) \]

[In]

Int[((2 + x)*(d + e*x))/(4 - 5*x^2 + x^4),x]

[Out]

-1/2*((d + e)*Log[1 - x]) + ((d + 2*e)*Log[2 - x])/3 + ((d - e)*Log[1 + x])/6

Rule 1600

Int[(u_.)*(Px_)^(p_.)*(Qx_)^(q_.), x_Symbol] :> Int[u*PolynomialQuotient[Px, Qx, x]^p*Qx^(p + q), x] /; FreeQ[
q, x] && PolyQ[Px, x] && PolyQ[Qx, x] && EqQ[PolynomialRemainder[Px, Qx, x], 0] && IntegerQ[p] && LtQ[p*q, 0]

Rule 2099

Int[(P_)^(p_)*(Q_)^(q_.), x_Symbol] :> With[{PP = Factor[P]}, Int[ExpandIntegrand[PP^p*Q^q, x], x] /;  !SumQ[N
onfreeFactors[PP, x]]] /; FreeQ[q, x] && PolyQ[P, x] && PolyQ[Q, x] && IntegerQ[p] && NeQ[P, x]

Rubi steps \begin{align*} \text {integral}& = \int \frac {d+e x}{2-x-2 x^2+x^3} \, dx \\ & = \int \left (\frac {d+2 e}{3 (-2+x)}+\frac {-d-e}{2 (-1+x)}+\frac {d-e}{6 (1+x)}\right ) \, dx \\ & = -\frac {1}{2} (d+e) \log (1-x)+\frac {1}{3} (d+2 e) \log (2-x)+\frac {1}{6} (d-e) \log (1+x) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 39, normalized size of antiderivative = 0.93 \[ \int \frac {(2+x) (d+e x)}{4-5 x^2+x^4} \, dx=\frac {1}{6} (-3 (d+e) \log (1-x)+2 (d+2 e) \log (2-x)+(d-e) \log (1+x)) \]

[In]

Integrate[((2 + x)*(d + e*x))/(4 - 5*x^2 + x^4),x]

[Out]

(-3*(d + e)*Log[1 - x] + 2*(d + 2*e)*Log[2 - x] + (d - e)*Log[1 + x])/6

Maple [A] (verified)

Time = 0.05 (sec) , antiderivative size = 38, normalized size of antiderivative = 0.90

method result size
default \(\left (\frac {d}{6}-\frac {e}{6}\right ) \ln \left (x +1\right )+\left (-\frac {d}{2}-\frac {e}{2}\right ) \ln \left (x -1\right )+\left (\frac {d}{3}+\frac {2 e}{3}\right ) \ln \left (x -2\right )\) \(38\)
norman \(\left (\frac {d}{6}-\frac {e}{6}\right ) \ln \left (x +1\right )+\left (-\frac {d}{2}-\frac {e}{2}\right ) \ln \left (x -1\right )+\left (\frac {d}{3}+\frac {2 e}{3}\right ) \ln \left (x -2\right )\) \(38\)
parallelrisch \(\frac {\ln \left (x -2\right ) d}{3}+\frac {2 \ln \left (x -2\right ) e}{3}-\frac {\ln \left (x -1\right ) d}{2}-\frac {\ln \left (x -1\right ) e}{2}+\frac {\ln \left (x +1\right ) d}{6}-\frac {\ln \left (x +1\right ) e}{6}\) \(44\)
risch \(\frac {\ln \left (x +1\right ) d}{6}-\frac {\ln \left (x +1\right ) e}{6}-\frac {\ln \left (1-x \right ) d}{2}-\frac {\ln \left (1-x \right ) e}{2}+\frac {\ln \left (2-x \right ) d}{3}+\frac {2 \ln \left (2-x \right ) e}{3}\) \(52\)

[In]

int((x+2)*(e*x+d)/(x^4-5*x^2+4),x,method=_RETURNVERBOSE)

[Out]

(1/6*d-1/6*e)*ln(x+1)+(-1/2*d-1/2*e)*ln(x-1)+(1/3*d+2/3*e)*ln(x-2)

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 32, normalized size of antiderivative = 0.76 \[ \int \frac {(2+x) (d+e x)}{4-5 x^2+x^4} \, dx=\frac {1}{6} \, {\left (d - e\right )} \log \left (x + 1\right ) - \frac {1}{2} \, {\left (d + e\right )} \log \left (x - 1\right ) + \frac {1}{3} \, {\left (d + 2 \, e\right )} \log \left (x - 2\right ) \]

[In]

integrate((2+x)*(e*x+d)/(x^4-5*x^2+4),x, algorithm="fricas")

[Out]

1/6*(d - e)*log(x + 1) - 1/2*(d + e)*log(x - 1) + 1/3*(d + 2*e)*log(x - 2)

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 304 vs. \(2 (37) = 74\).

Time = 1.11 (sec) , antiderivative size = 304, normalized size of antiderivative = 7.24 \[ \int \frac {(2+x) (d+e x)}{4-5 x^2+x^4} \, dx=\frac {\left (d - e\right ) \log {\left (x + \frac {26 d^{3} + 66 d^{2} e - 9 d^{2} \left (d - e\right ) + 78 d e^{2} - 12 d e \left (d - e\right ) - 7 d \left (d - e\right )^{2} + 46 e^{3} + 3 e^{2} \left (d - e\right ) - 8 e \left (d - e\right )^{2}}{10 d^{3} + 69 d^{2} e + 102 d e^{2} + 35 e^{3}} \right )}}{6} - \frac {\left (d + e\right ) \log {\left (x + \frac {26 d^{3} + 66 d^{2} e + 27 d^{2} \left (d + e\right ) + 78 d e^{2} + 36 d e \left (d + e\right ) - 63 d \left (d + e\right )^{2} + 46 e^{3} - 9 e^{2} \left (d + e\right ) - 72 e \left (d + e\right )^{2}}{10 d^{3} + 69 d^{2} e + 102 d e^{2} + 35 e^{3}} \right )}}{2} + \frac {\left (d + 2 e\right ) \log {\left (x + \frac {26 d^{3} + 66 d^{2} e - 18 d^{2} \left (d + 2 e\right ) + 78 d e^{2} - 24 d e \left (d + 2 e\right ) - 28 d \left (d + 2 e\right )^{2} + 46 e^{3} + 6 e^{2} \left (d + 2 e\right ) - 32 e \left (d + 2 e\right )^{2}}{10 d^{3} + 69 d^{2} e + 102 d e^{2} + 35 e^{3}} \right )}}{3} \]

[In]

integrate((2+x)*(e*x+d)/(x**4-5*x**2+4),x)

[Out]

(d - e)*log(x + (26*d**3 + 66*d**2*e - 9*d**2*(d - e) + 78*d*e**2 - 12*d*e*(d - e) - 7*d*(d - e)**2 + 46*e**3
+ 3*e**2*(d - e) - 8*e*(d - e)**2)/(10*d**3 + 69*d**2*e + 102*d*e**2 + 35*e**3))/6 - (d + e)*log(x + (26*d**3
+ 66*d**2*e + 27*d**2*(d + e) + 78*d*e**2 + 36*d*e*(d + e) - 63*d*(d + e)**2 + 46*e**3 - 9*e**2*(d + e) - 72*e
*(d + e)**2)/(10*d**3 + 69*d**2*e + 102*d*e**2 + 35*e**3))/2 + (d + 2*e)*log(x + (26*d**3 + 66*d**2*e - 18*d**
2*(d + 2*e) + 78*d*e**2 - 24*d*e*(d + 2*e) - 28*d*(d + 2*e)**2 + 46*e**3 + 6*e**2*(d + 2*e) - 32*e*(d + 2*e)**
2)/(10*d**3 + 69*d**2*e + 102*d*e**2 + 35*e**3))/3

Maxima [A] (verification not implemented)

none

Time = 0.18 (sec) , antiderivative size = 32, normalized size of antiderivative = 0.76 \[ \int \frac {(2+x) (d+e x)}{4-5 x^2+x^4} \, dx=\frac {1}{6} \, {\left (d - e\right )} \log \left (x + 1\right ) - \frac {1}{2} \, {\left (d + e\right )} \log \left (x - 1\right ) + \frac {1}{3} \, {\left (d + 2 \, e\right )} \log \left (x - 2\right ) \]

[In]

integrate((2+x)*(e*x+d)/(x^4-5*x^2+4),x, algorithm="maxima")

[Out]

1/6*(d - e)*log(x + 1) - 1/2*(d + e)*log(x - 1) + 1/3*(d + 2*e)*log(x - 2)

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 35, normalized size of antiderivative = 0.83 \[ \int \frac {(2+x) (d+e x)}{4-5 x^2+x^4} \, dx=\frac {1}{6} \, {\left (d - e\right )} \log \left ({\left | x + 1 \right |}\right ) - \frac {1}{2} \, {\left (d + e\right )} \log \left ({\left | x - 1 \right |}\right ) + \frac {1}{3} \, {\left (d + 2 \, e\right )} \log \left ({\left | x - 2 \right |}\right ) \]

[In]

integrate((2+x)*(e*x+d)/(x^4-5*x^2+4),x, algorithm="giac")

[Out]

1/6*(d - e)*log(abs(x + 1)) - 1/2*(d + e)*log(abs(x - 1)) + 1/3*(d + 2*e)*log(abs(x - 2))

Mupad [B] (verification not implemented)

Time = 7.78 (sec) , antiderivative size = 38, normalized size of antiderivative = 0.90 \[ \int \frac {(2+x) (d+e x)}{4-5 x^2+x^4} \, dx=\ln \left (x-2\right )\,\left (\frac {d}{3}+\frac {2\,e}{3}\right )-\ln \left (x-1\right )\,\left (\frac {d}{2}+\frac {e}{2}\right )+\ln \left (x+1\right )\,\left (\frac {d}{6}-\frac {e}{6}\right ) \]

[In]

int(((x + 2)*(d + e*x))/(x^4 - 5*x^2 + 4),x)

[Out]

log(x - 2)*(d/3 + (2*e)/3) - log(x - 1)*(d/2 + e/2) + log(x + 1)*(d/6 - e/6)